import Vue from "vue";
import App from "@/App";
import router from "@/router"; // api: https://github.com/vuejs/vue-router
import store from "@/store"; // api: https://github.com/vuejs/vuex
import VueCookie from "vue-cookie";
import * as echarts from "echarts"; // api: https://github.com/alfhen/vue-cookie
import "@/element-ui";
// import '@/element-ui-theme'
// import 'element-ui'
import "element-ui/lib/theme-chalk/index.css";
import VueParticles from "vue-particles";
import "@/icons"; // api: http://www.iconfont.cn/
import "@/assets/scss/index.scss";
import "@/assets/font/iconfont.css";
import "../static/iconfont/iconfont.css";
import httpRequest from "@/utils/httpRequest"; // api: https://github.com/axios/axios
import { isAuth } from "@/utils";
import "@/directives";
import Axios from "axios";
import cloneDeep from "lodash/cloneDeep";
import AwenComponent from "@/components";
import { JSONToExcelConvertor } from './assets/js/JSONToExcelConvertor'
import {
  PageHeader,
  Checkbox,
  CheckboxGroup,
  Cascader,
  Radio,
  RadioGroup,
  Container,
  Header,
  Aside,
  Main,
  Footer,
  Row,
  Col,
  Pagination,
  Dialog,
  Button,
  Input,
  Table,
  TableColumn,
  Form,
  FormItem,
  Dropdown,
  Breadcrumb,
  BreadcrumbItem,
  Autocomplete,
  DropdownMenu,
  DropdownItem,
  Menu,
  Submenu,
  MenuItem,
  MenuItemGroup,
  MessageBox,
  Message,
  Loading,
  Notification,
  DatePicker,
  TimeSelect,
  TimePicker,
  Tabs,
  Select,
  Option,
  OptionGroup,
  TabPane,
  Tooltip,
  Progress,
  Carousel,
  CarouselItem,
  Upload,
  Popover,
  Tag,
  Tree,
  Image,
  Scrollbar,
  Steps,
  Step,
  Divider
} from "element-ui";
Vue.use(DatePicker);
Vue.use(TimeSelect);
Vue.use(TimePicker);
Vue.use(Divider);
Vue.use(AwenComponent);
Vue.use(VueCookie);
Vue.config.productionTip = false;
Vue.use(VueParticles);
Vue.prototype.$echarts = echarts;
Vue.prototype.setTableMaxHeight = function() {
  //设置表格的最大高度
  var height = document.getElementById("manage").clientHeight;
  var conditionHeight = document.getElementsByClassName("condition")[0]
    .clientHeight; //条件框高度
  var marginBottom = 12; //筛选条件和表格的距离
  var pageHeight = 42; //分页的高度
  return height - conditionHeight - marginBottom - pageHeight;
};
// 挂载全局
Vue.prototype.$http = httpRequest; // ajax请求方法
Vue.prototype.isAuth = isAuth; // 权限方法
Vue.prototype.JSONToExcelConvertor = JSONToExcelConvertor

// 保存整站vuex本地储存初始状态
window.SITE_CONFIG["storeState"] = cloneDeep(store.state);
Object.defineProperty(Vue.prototype, "$axios", {
  get() {
    return Axios;
  }
});
/* eslint-disable no-new */
new Vue({
  el: "#app",
  router,
  store,
  template: "<App/>",
  components: { App }
});
